home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / sound / players / waveplay.zoo / riff.h < prev    next >
Text File  |  1992-12-06  |  2KB  |  101 lines

  1. /*
  2.     The following definitions are those of the MicroSoft Corp
  3.     WAVE files.
  4.  
  5.     The PCM Samples are strangely arranged to allow simple
  6.     conversion fom the MicroSoft format for 8 bit samples
  7.     to the format used by ATARI.
  8. */
  9.  
  10. typedef union {
  11.   unsigned int  Atari ;
  12.   unsigned char MSC[2] ;
  13. } INTEGER ;
  14.  
  15. typedef union {
  16.   unsigned long Atari ;
  17.   unsigned char MSC[4] ;
  18. } LONG ;
  19.  
  20. typedef struct {
  21.     unsigned char  left ;
  22.     unsigned char  right ;
  23. } STEREO_8 ;
  24.  
  25. typedef struct {
  26.     unsigned char lower ;
  27.     unsigned char upper ;
  28. } MONO_16 ;
  29.  
  30. typedef struct {
  31.     MONO_16 left ;
  32.     MONO_16 right ;
  33. } STEREO_16 ;
  34.  
  35. typedef union
  36. {
  37.   unsigned char * Mono8 ;
  38.   STEREO_8      * Stereo8 ;
  39.   MONO_16       * Mono16 ;
  40.   STEREO_16     * Stereo16 ;
  41. } PCM_Samples ;
  42.  
  43. typedef struct
  44. {
  45.   char            riffStr[4];
  46.   unsigned long   ckSize ;    /* Chunk Size */
  47.   char            waveStr[4] ;
  48. } WAVE_FILE ;
  49.  
  50. typedef struct
  51. {
  52.   char            ckStr[4] ;
  53.   unsigned long   ckSize ;
  54. } CHK_DEF ;
  55.  
  56. typedef struct
  57. {
  58.   unsigned int    formatTag ;
  59.   unsigned int    nChannels ;
  60.   unsigned long   nSamplesPerSec ;
  61.   unsigned long   nAvgBytesPerSec ;
  62.   unsigned int    nBlockAlign ;
  63.   unsigned int    nBitsPerSample ;
  64. } WAVE_HDR ;
  65.  
  66. typedef struct
  67. {
  68.   WAVE_HDR          hdr ;
  69.   CHK_DEF           data ;
  70.   unsigned long     Target_SpS ;
  71.   unsigned long     required_memory ;
  72.   PCM_Samples       PCM ; /* hex */
  73. } WAVE_DEFINITION ;
  74.  
  75.  
  76. /*
  77.   This next section will define all of the WAVEPLAYER
  78.   functions
  79. */
  80. void Resample8bitMono(PCM_Samples *Dest,
  81.                       PCM_Samples *Src,
  82.                       unsigned long Dest_Sample_Rate,
  83.                       unsigned long Src_Sample_Rate) ;
  84.  
  85. void Resample16bitMono(PCM_Samples *Dest,
  86.                        PCM_Samples *Src,
  87.                        unsigned long Dest_Sample_Rate,
  88.                        unsigned long Src_Sample_Rate) ;
  89.  
  90. void Resample8bitStereo(PCM_Samples *Dest,
  91.                         PCM_Samples *Src,
  92.                         unsigned long Dest_Sample_Rate,
  93.                         unsigned long Src_Sample_Rate) ;
  94.  
  95. void Resample16bitStereo(PCM_Samples *Dest,
  96.                          PCM_Samples *Src,
  97.                          unsigned long Dest_Sample_Rate,
  98.                          unsigned long Src_Sample_Rate) ;
  99.  
  100. void FatalError (char *identifier) ;
  101.